using UnityEngine;
using QFramework;
using Unity.VisualScripting;
using System.Linq;

namespace Projectsurviva
{
	public partial class AbilityController : ViewController,IController
	{
        public IArchitecture GetArchitecture()
        {
            return Global.Interface;

        }

        void Start()
		{
			// Code Here
			Global.SimpleSwordUnlocked.RegisterWithInitValue(unlocked =>
			{
				if(unlocked)
				{
					SimpleSword.Show()
					;
				}
			}).UnRegisterWhenGameObjectDestroyed(gameObject);
            Global.SimpleKnifeUnlocked.RegisterWithInitValue(unlocked =>
            {
                Debug.Log(unlocked + "----");
                if (unlocked)
                {
                 
                    SimpleKnife.Show()
                    ;
                }
            }).UnRegisterWhenGameObjectDestroyed(gameObject);
            Global.RotateSwordUnlocked.RegisterWithInitValue(unlocked =>
            {
                if (unlocked)
                {
                    SimpleRoteSword.Show()
                    ;
                }
            }).UnRegisterWhenGameObjectDestroyed(gameObject);
            Global.BasketBallUnlocked.RegisterWithInitValue(unlocked =>
            {
                if (unlocked)
                {
                    BasketBallAbliti.Show()
                    ;
                }
            }).UnRegisterWhenGameObjectDestroyed(gameObject);
            this.GetSystem<ExpSystem>().Items.Where(item=>item.Isweapon).ToList().GetRandomItem().Upgrade();
        }
	}
}
